function Event() {
	var me = this;
	var events;
	
	me.events = {};
}

Event.prototype.on = function(eventName, callback) {
	var me = this;
	var events = eventName.split(',');

	for (var i = 0; i < events.length; ++i) {
		var eventToAdd = events[i].replace(' ', '');
		if (me.events[eventToAdd])
			me.events[eventToAdd].push(callback);
	}
};

Event.prototype.broadcast = function(eventName, dataToBroadcast, dataToBroadcast2, dataToBroadcast3) {
	var me = this;
	
	if (me.events[eventName]) {
		console.log('[' + eventName + '] Event raised.');
		for (var i = 0; i < me.events[eventName].length; ++i) {
			if (dataToBroadcast != undefined)
				me.events[eventName][i](dataToBroadcast, dataToBroadcast2, dataToBroadcast3);
			else
				me.events[eventName][i](me);
		}
	}
};

Object.defineProperty(Event.prototype, "Events", {
	get : function() {
		return this.events;
	},
	set : function(value) {
		this.events = value;
	}
});
